package filterDesignPattern;

/**
 * 
 * @author Anitta
 * Concrete class implementing interface Criteria to filter list of Employee object using age criteria.
 *
 */

import java.util.ArrayList;
import java.util.List;

import classes.Employee;


public class AdultCriteria implements Criteria {

	public List<Employee> filter(List<Employee> employee) {
		List<Employee> adult = new ArrayList<Employee>();
		for(Employee e: employee){
			if(e.getAge()>24){
				adult.add(e);
			}
		}
		return adult;
	}

}
